import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.Color;

import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class TelaLogin extends JFrame {

	private JPanel contentPane;
	private JPasswordField passwordField;
	private JTextField textField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaLogin frame = new TelaLogin();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TelaLogin() {
		setTitle("PhotoMack");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBackground(Color.WHITE);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JLabel lblNewLabel = new JLabel(
				"Bem vindo ao editor gr\u00E1fico PhotoFace");
		lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblNewLabel.setBounds(41, 11, 354, 22);
		contentPane.add(lblNewLabel);

		JTextPane txtpnParaUsufluirDo = new JTextPane();
		txtpnParaUsufluirDo.setEditable(false);
		txtpnParaUsufluirDo.setFont(new Font("Tahoma", Font.PLAIN, 18));
		txtpnParaUsufluirDo
				.setText("Para usufluir do editor, efetue o login ou cadastre-se gratuitamente.");
		txtpnParaUsufluirDo.setBounds(41, 63, 354, 55);
		contentPane.add(txtpnParaUsufluirDo);

		passwordField = new JPasswordField();
		passwordField.setBounds(107, 177, 248, 22);
		contentPane.add(passwordField);

		textField = new JTextField();
		textField.setBounds(107, 149, 248, 22);
		contentPane.add(textField);
		textField.setColumns(10);

		JLabel lblLogin = new JLabel("Login");
		lblLogin.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblLogin.setBounds(41, 147, 56, 21);
		contentPane.add(lblLogin);

		JLabel lblSenha = new JLabel("Senha");
		lblSenha.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblSenha.setBounds(41, 175, 64, 21);
		contentPane.add(lblSenha);

		JButton btnNewButton = new JButton("Entrar");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				int resposta = JOptionPane.showConfirmDialog(null, "Usuario Logado");
				
				if (resposta == JOptionPane.YES_OPTION){
					Tela1 t1 = new Tela1();
					t1.setVisible(true);
					
					dispose();
				}
				
			}
		});
		btnNewButton.setBounds(294, 227, 101, 23);
		contentPane.add(btnNewButton);

		JButton btnCadastrar = new JButton("Cadastrar");
		btnCadastrar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				int resposta = JOptionPane.showConfirmDialog(null, "Cadastrar?");
								
				TelaCadastro tc = new TelaCadastro();
				tc.setVisible(true);

			}
		});
		btnCadastrar.setBounds(183, 227, 101, 23);
		contentPane.add(btnCadastrar);
	}
}
